package config

import "github.com/androidsr/sc-go/syaml"

var CFG *Config

func init() {
	var err error
	CFG, err = syaml.LoadFile[Config]("sc-go.yaml")
	if err != nil {
		panic(err)
	}
}

type Config struct {
	Sc  *syaml.ScInfo `yaml:"sc"`
	Llm struct {
		Ollama Ollama `yaml:"ollama"`
		Openai Openai `yaml:"openai"`
	} `yaml:"llm"`
}

type Ollama struct {
	ModelList         []string `yaml:"modelList"`
	Enable            bool     `yaml:"enable"`
	Url               string   `yaml:"url"`
	Model             string   `yaml:"model"`
	Token             string   `yaml:"token"`
	EmbeddingModel    string   `yaml:"embeddingModel"`
	EmbeddingDatabase string   `yaml:"embeddingDatabase"`
}

type Openai struct {
	ModelList         []string `yaml:"modelList"`
	Enable            bool     `yaml:"enable"`
	Url               string   `yaml:"url"`
	Model             string   `yaml:"model"`
	EmbeddingModel    string   `yaml:"embeddingModel"`
	Token             string   `yaml:"token"`
	EmbeddingUrl      string   `yaml:"embeddingUrl"`
	EmbeddingDatabase string   `yaml:"embeddingDatabase"`
}
